package com.ocm.resource.config;

import io.minio.MinioClient;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * Author:   hqy
 * Date:     2021/9/26 17:45
 * Description:
 */
@Component
@Data
public class MinioConfig {


    @Value(value = "${minio.url}")
    private String url;

    @Value(value = "${minio.accessKey}")
    private String accessKey;

    @Value(value = "${minio.secretKey}")
    private String secretKey;

    @Value(value = "${minio.Folder}")
    private String Folder;


    @Bean
    public MinioClient minioClient() {
        try {
            return new MinioClient(url, accessKey, secretKey);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }

}
